/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-09-11
 * Time: 8:45
 */
public class test {
    public static void main(String[] args) {
        plural plural1 = new plural(1,2);
        plural plural2 = new plural(3,-4);
        plural sum = plural.add(plural1, plural2);
        System.out.println("plural1与plural2之和："+sum.getReal() + "+" + sum.getImaginary()+"i");
        plural dif = plural.sub(plural1, plural2);
        System.out.println("plural1与plural2之差："+ dif.getReal() + "+" + dif.getImaginary()+"i");
        plural pro = plural.mul(plural1, plural2);
        System.out.println("plural1与plural2之积："+pro.getReal() + "+" + pro.getImaginary()+"i");
        System.out.println("plural1的实部为：" + plural1.getReal());
        System.out.println("plural1的虚部为：" + plural1.getImaginary());
        System.out.println("plural2的实部为：" + plural2.getReal());
        System.out.println("plural2的实部为：" + plural2.getImaginary());
    }
}
